package emulator.hardware;

public class HwByte extends HwNumber {

	public HwByte(long number) {
		super(number);
	}
	
	public HwByte() {
		super(0);
	}

	@Override
	void normalize() {
		number &= 0xff;
	}

	@Override
	public String toString() {
		String text = Integer.toHexString((int) number).toUpperCase();
		if (text.length() < 2)
			text = "0"+text;
		return text;
	}

	public boolean isZero() {
		return number == 0;
	}

	public boolean isNegative() {
		return number > 127;
	}

}
